<include file="Public:header"/>
<script type="text/javascript" src="__WEBPUBLIC__/Admin/js/ajax-operate.js"></script>
<!--主页面-->
<div id="main-content" class="content">
    <ul class="breadcrumb">
        <li><a href="{:U('Index/main')}">首页</a></li>
        <li class="active"><a href="">商家管理</a></li>
        <li class="active">商家列表</li>
    </ul>

    <div class="page-header page-header1 clearfix">
        <h3>商家管理</h3>
        <ul class="nav nav-tabs">
            <li class="active">
                <a href="{:U('Shop/ShopList')}">商家列表</a>
            </li>
            <li class="">
                <a href="{:U('Shop/addShop')}">添加商家</a>
            </li>
        </ul>
    </div>
    <div class="search-content">
        <form action="{:U('Shop/ShopList')}" method="post" class="search-form form-inline" role="form">
            <div class="form-group">
                <label class="sr-only" for="Shop_sn">商家名称</label>
                <input class="earch-input form-control" id="Shop_sn" type="text" name="name" value="{$request['name']}" placeholder="商家名称"/>　
            </div>
            <div class="form-group">
                <label class="sr-only" for="Shop_sn">商家账号</label>
                <input class="earch-input form-control" id="account" type="text" name="account" value="{$request['account']}" placeholder="商家账号"/>　
            </div>
            <div class="form-group">
                <div class="col-sm-9">
                    <select name="status" id="" class="form-control input-small form-control-select">
                        <option value="">筛选状态...</option>
                        <option value="1" <if condition="$status eq 1">selected</if>>审核成功</option>
                        <option value="2" <if condition="$status eq 2">selected</if>>待审核</option>
                    </select>
                </div>
            </div>
            <!--<div class="form-group">-->
                <!--<div class="col-sm-9">-->
                    <!--<select name="class_id" id="" class="form-control input-small form-control-select">-->
                        <!--<option value="">商家类型...</option>-->
                        <!--<volist name="type" id="vo">-->
                        <!--<option value="{$vo['class_id']}" <if condition="$request['class_id'] eq $vo['class_id']">selected</if>>{$vo['name']}</option>-->
                        <!--</volist>-->
                    <!--</select>-->
                <!--</div>-->
            <!--</div>-->
            <button type="submit" class="btn derive">查询</button>
        </form>
    </div>
    <div class="content-box-table content-box-content">
        <form action="{:U('Shop/deleteShop')}" method="post" class="batch-form">
            <table class="table table-striped table-framed table-hover">
                <thead>
                <tr>
                    <th width="8%">
                        <input class="check-all" type="checkbox" />&nbsp;&nbsp;编号
                    </th>
                    <th>商家名称</th>
                    <th>入驻时间</th>
                    <th width="">省</th>
                    <th width="">市</th>
                    <th width="">区</th>
                    <th>商家账号</th>
                    <th>商家类型</th>
                    <th>营业时间</th>
                    <th>商家联系电话</th>
                    <th>商家详细地址</th>
                    <th>商家余额</th>
                    <th>商家的状态</th>
                    <th>总的消费</th>
                    <th>满足股数相差金额</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody class="tbody">
                <if condition="empty($list)">
                    <tr><td colspan="20"><span style="font-size:14px;">暂无数据</span></td></tr>
                </if>
                <volist name="list" id="vo">
                    <tr>
                        <td><input type="checkbox" value="{$vo['shop_id']}" name="shop_id[]"/>&nbsp;&nbsp;{$vo['shop_id']}</td>
                        <td>{$vo['name']}</td>
                        <td>{$vo['ctime']|date='Y-m-d H:i:s',###}</td>
                        <td>{$vo['province_name']}</td>
                        <td>{$vo['city_name']}</td>
                        <td>{$vo['area_name']}</td>
                        <td>{$vo['account']}</td>
                        <td>{$vo['class_name']|default='未填写'}</td>
                        <td>{$vo['time']}</td>
                        <td>{$vo['tel']|default='未填写'}</td>
                        <td>{$vo['address']|default='未填写'}</td>
                        <td>{$vo['wallet']|default='未填写'}/元</td>
                        <td>
                            <if condition="$vo['status'] eq 0"><span style="color: green">正常</span>
                                <elseif condition="$vo['status'] eq 1" /><span style="color: red">待审核</span>
                                <elseif condition="$vo['status'] eq 2" /><span style="color: red">审核失败</span>
                            </if>
                        </td>
                        <td>{$vo['total']|default="0.00"}</td>
                        <td>{$vo['earn_total']|default="0.00"}</td>
                        <td>
                            <a href="{:U('Shop/editShop',array('shop_id'=>$vo['shop_id']))}" title="修改" class="modify">
                                <span class="icon glyphicon glyphicon-pencil"></span>
                            </a>&nbsp;&nbsp;
                            <a href="{:U('Shop/editShop',array('shop_id'=>$vo['shop_id']))}" title="商家的订单" class="modify">
                                <span class="icon glyphicon glyphicon-list"></span>
                            </a>&nbsp;
                            <a href="{:U('Shop/appraise',array('shop_id'=>$vo['shop_id']))}" title="商家的评价信息" class="modify">
                                <span class="icon glyphicon glyphicon-comment"></span>
                            </a>&nbsp;
                            <a href="{:U('Shop/downLoadShopCode',array('shop_id'=>$vo['shop_id']))}" title="下载二维码" class="modify">
                                <span class="icon glyphicon glyphicon-qrcode"></span>
                            </a>&nbsp;&nbsp;
                            <a href="#" title="删除" class="delete-delete">
                                <span class="icon glyphicon glyphicon-remove"></span>
                            </a><input type="hidden" value="{:U('Shop/deleteShop',array('shop_id'=>$vo['shop_id']))}">
                        </td>
                    </tr>
                </volist>
                </tbody>
                <tfoot>
                <tr>
                    <td colspan="20">
                        <div class="bulk-actions fl">
                            <input type="button" class="btn delete-batch" value="批量删除">　
                        </div>
                        <div class="bulk-actions fl">
                            <a href="{:U('Shop/ShopXLS')}" style="text-decoration: none;color: #ffffff"><input type="button" class="btn" value="导出商家列表" style="background: green">　</a>
                        </div>
                        <div class="fr">
                            {$page}
                        </div>
                        <if condition="!empty($page)">
                            <div style="padding:24px 10px;float:right;">
                                <span style="font-size: 16px">转到第</span>&nbsp;
                                <input type="tel"  min="1" max="" name="" id="page_num" style="border: 1px solid #ccc;width:50px;height:27px;text-align: center;" value="{:I('get.p')}" placeholder="1"/>&nbsp;
                                <span style="font-size: 16px">页</span>
                                <input type="button" id="go" value="Go" style="width: 45px;height:30px;border:0;background-color: #c5c5c5;border-radius:1px;color: #ffffff;cursor: pointer"/>
                                <input type="hidden" value="{$_SERVER['REQUEST_URI']}"/>
                                <input type="hidden" id="p" value="{:I('get.p')}"/>
                            </div>
                        </if>
                    </td>
                </tr>
                </tfoot>
            </table>
        </form>
    </div>
</div>
<script>
    $(document).ready(function(){
        $('.scale_p').change(function(){
            var id = $(this).next('input').val();
            var scale_p = $(this).val();
            var url = "{:U('Shop/ajaxShop')}";
            $.post(url,{'id':id,'scale_p':scale_p},function(data){
                if(data==1){
                    alert("修改成功");
                    window.location.reload();
                }else{
                    alert("修改失败");
                }
            });
        });
        $('.scale_member').change(function(){
            var id = $(this).next('input').val();
            var scale_member = $(this).val();
            var url = "{:U('Shop/ajaxMember')}";
            $.post(url,{'id':id,'scale_member':scale_member},function(data){
                if(data==1){
                    alert("修改成功");
                    window.location.reload();
                }else{
                    alert("修改失败");
                }
            });

        });
    });

</script>
<include file="Public:footer"/>

